x86/EFI: allow FPU/XMM use in runtime service functions
authorJan Beulich <jbeulich@suse.com>
Wed, 18 Jun 2014 13:53:27 +0000 (15:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Jun 2014 13:53:27 +0000 (15:53 +0200)
commite0fe297dabc96d8161d568f19a99722c4739b9f9
treebf4dbfedd376fd2ac114e1bf33740eb79f8dcb03
parent86104258d36a2d3b0c92aabd2147c731b792f501
x86/EFI: allow FPU/XMM use in runtime service functions

UEFI spec update 2.4B developed a requirement to enter runtime service
functions with CR0.TS (and CR0.EM) clear, thus making feasible the
already previously stated permission for these functions to use some of
the XMM registers. Enforce this requirement (along with the connected
ones on FPU control word and MXCSR) by going through a full FPU save
cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
specified values into the other two registers).

Note that the UEFI spec mandates that extension registers other than
XMM ones (for our purposes all that get restored eagerly) are preserved
across runtime function calls, hence there's nothing we need to restore
in efi_rs_leave() (they do get saved, but just for simplicity's sake).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/efi/runtime.c
xen/arch/x86/i387.c
xen/include/asm-x86/i387.h